#ifndef _NE_OBJECT_H_
#define _NE_OBJECT_H_

#include <neinit.h>

namespace ne
{
    class Object
    {
        public:
            explicit Object(const std::string &name="Object")
                : mObjectName(name)
            {
            }

            Object(const Object &obj)
                : mObjectName(obj.mObjectName)
            {
            }

            Object& operator = (const Object &obj)
            {
                mObjectName = obj.mObjectName;
                return *this;
            }

            virtual void setObjectName(const std::string &name)
            {
                mObjectName = name;
            }

            virtual const std::string& getObjectName() const
            {
                return mObjectName;
            }

            virtual const char* getObjectType() const
            {
                return typeid(*this).name();
            }

            virtual const std::type_info& type() const
            {
                return typeid(*this);
            }

            friend std::ostream& operator << (std::ostream& o, const Object &obj)
            {
                o << "Object(name=" << obj.getObjectName() <<
                          ", type=" << obj.getObjectType() << ")";
                return o;
            }

            virtual ~Object()
            {
            }

        protected:
            std::string mObjectName;
    };
}

#endif
